<?

$d = component_data($c); 
$s = component_settings($c);

//debug($s);	
//debug($d);	

?><div id="cpn-<?=$c?>" class="recent-list"><?

	if ($s['caption']) { ?><div class="caption"><?=$s['caption']?></div><? }
	
	if (sizeof($d = component_data($c))) {
		
		switch ($s['show_type']) {	
			case 0: ?><ul><? break;
			case 1: ?><div class="blocks"><? break;
		}
	
		foreach($d as $id => $v) {
			$url = "$s[base]$id/";
			$class = array($v['first'], $v['last']);
	
			switch ($s['show_type']) {	
				case 0: ?><li class="<?=implode(' ', $class)?>"><? break;
				case 1: $class[] = 'block'; ?><div class="<?=implode(' ', $class)?>"><? break;
			}

				if ($s['show_tn'] && $im = $v['tn']) {
					if ($s['tn_sized']) {
						$_x = (int)$s['tnx']; $_y = (int)$s['tny'];
					} else {
						$_x = $im['x']; $_y = $im['y'];
					}
					?><img src="<?=$im['fn']?>" width="<?=$_x?>" height="<?=$_y?>" /><?
				}
				
				?><div class="text-box"><?
	
					if ($s['show_title']) { 
						?><div class="block-title"><?

							if ($s['show_date'] && $v['date_create']) { ?><div class="date"><?=$v['date']?></div><? }
							
							?><h2><a href="<?=$url?>" title="<?=h($v['title'])?>" class="title link"><?=$v['title']?></a></h2><?
						
						?></div><? 
					}
		
					if ($s['show_anons'] && $v['anons']) { ?><div class="anons"><?=strip_tags($v['anons'])?></div><? }
	
					if ($s['show_body'] && $v['body']) { ?><div class="body"><?=$v['body']?></div><? }
				
				?></div><?
			
			switch ($s['show_type']) {	
				case 0: ?></li><? break;
				case 1: ?></div><? break;
			}
		}
		
		switch ($s['show_type']) {	
			case 0: ?></ul><? break;
			case 1: ?></div><? break;
		}
	 
	}
	?><div class="clearer"></div><?

?></div><?
	
?>